<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" />
		<meta name="apple-wap-web-app-capable" content="yes">
		<meta name="apple-wap-web-app-status-bar-style" content="black-translucent">
		<meta name="MobileOptimized" content="240"/>
		<title>首页</title>
		<link rel="stylesheet" href="$!webPath/css/reset.css" />
		<link rel="stylesheet" href="$!webPath/css/style.css" />
		<script src="$!webPath/js/jquery.min.js"></script>
		<script src="$!webPath/js/dropload.min.js"></script>
		<script src="$!webPath/js/zepto.min.js"></script>
		<style>

		</style>
	</head>
	<body>
		<div class="all">
			<!--单个内容-->
			<a href="$!webPath/activity/activity_introduce?id=$!{recommendActivity.id}">
				<div class="content">
					<div class="content-top">
						<img width="100%" src="$!recommendActivity.picPath" />
					</div>
					<div class="content-bot-title">
						$!recommendActivity.activityName
					</div>
					#if($!recommendActivity.isNew == 1)
					<div class="content-bot-img">
						<img width="30px" src="$!webPath/imgs/NEW.png">
					</div>
					#end
					<div class="content-bot-text">
						$!recommendActivity.activityIntroduction
					</div>
				</div>
			</a>

			<section class="index_list">
				#foreach($obj in $!homeIntroductionEntities)
				<a href="$!webPath/home/homeIntroduction?id=$!{obj.id}">
					<div class="content">
						<div class="content-top">
							<img width="100%" src="$!webPath$!obj.picPath">
						</div>
						<div class="content-bot-title">
							$!obj.name
						</div>
						<div class="content-bot-text">
							$!obj.shortTitle
						</div>
					</div>
				</a>
				#end
			</section>
			

		</div>

		<div id="scroll_bottom" ></div>
		<!--按钮-->
		<div class="footer">
			<a href="$!webPath/home/index" style="background-color: #ffcc00"><img width="100%" src="$!webPath/imgs/a2.png"></a>
			<a href="$!webPath/activity/activity_list"><img width="100%" src="$!webPath/imgs/b1.png"></a>
			<a href="$!webPath/team/ranking?page=0&size=20"><img width="100%" src="$!webPath/imgs/c1.png"></a>
			<a href="$!webPath/ticket/list"><img width="100%" src="$!webPath/imgs/d1.png"></a>
			<a href="$!webPath/user/my_account"><img width="100%" src="$!webPath/imgs/e1.png"></a>
		</div>
		<script>
			var mar_height=$('.footer a img').css('height');
			$('.all').css('margin-bottom',mar_height);
			jQuery(function(){
				var page=0;
				var a=true;
				jQuery(window).scroll(function(){
					var result='';
					var bot = 50; //bot是底部距离的高度
					if (((bot + $(window).scrollTop()) >= ($(document).height() - $(window).height()))&&a) {
						//当底部基本距离+滚动的高度〉=文档的高度-窗体的高度时；
						a=false;
						page++;
						console.log(page);
						$.ajax({
							type:'post',
							url: '$!webPath/home/homeIntroductionByPage?size=3&page=' + page,
							success: function (data) {
								console.log(typeof data);
								console.log(data);
								var result='';
								$.each(data.data.content,function(index,item){
									result+='<a href="$!webPath/home/homeIntroduction?id='+item.id+'"><div class="content"><div class="content-top"><img width="100%" src="$!webPath'+item.picPath+'"></div><div class="content-bot-title">'+item.name+'</div><div class="content-bot-text">'+item.shortTitle+'</div></div></a>';
								})

								$('.index_list').append(result);
								a=true;

							}
						})
					}else{
						$("#scroll_bottom").show().html("别滚动了，已经到底了。。。");
						return false;
					}
				})

			});

		</script>
	</body>

</html>
